package models.ru.paralainer.chat.server.domain;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

import play.db.jpa.Model;

/**
 * User: stalov
 * Date: 25.05.12
 * Time: 15:55
 */
@Entity
@NamedQueries(
        @NamedQuery(
                name = "User.findByUsername",
                query = "select o from User o where o.username = :username"
        )
)
@Table(
        uniqueConstraints = @UniqueConstraint(
                columnNames = "username",
                name = "usernameUnique"
        )
)
public class User extends Model {

    protected String username;
    
    protected String name;
    
    protected String vkontakte;
    
    protected String email;

    protected String password;

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getName() {
        return name;
    }

    public String getVkontakte() {
        return vkontakte;
    }

    public String getEmail() {
        return email;
    }
}
